% Load data for analysis

load('max_growthrate_arrays.mat');
load('activation_energies.mat');
clc;
close all;
%% Plot correlations between grmax and Ea

% Load max growth rates at 37 °C
grmax37_allconc_glucose = grmax_tot_glucose(:,3);
grmax37_allconc_glucose_err = grmax_err_tot_glucose(:,3);

grmax37_allconc_acetate = grmax_tot_acetate(:,3);
grmax37_allconc_acetate_err = grmax_err_tot_acetate(:,3);

grmax37_allconc_succinate = grmax_tot_succinate(:,3);
grmax37_allconc_succinate_err = grmax_err_tot_succinate(:,3);

grmax37_allconc_LB = grmax_tot_LB(:,3);
grmax37_allconc_LB_err = grmax_err_tot_LB(:,3);

grmax37_allconc_NZCasePlus = grmax_tot_NZCasePlus(:,3);
grmax37_allconc_NZCasePlus_err = grmax_err_tot_NZCasePlus(:,3);

% Now do plotting

figure;
errorbar(Ea_glucose, grmax37_allconc_glucose, grmax37_allconc_glucose_err, 'bo-', 'linewidth', 1);
hold on;

errorbar(Ea_acetate, grmax37_allconc_acetate, grmax37_allconc_acetate_err, 'ko-', 'linewidth', 1);

errorbar(Ea_succinate, grmax37_allconc_succinate, grmax37_allconc_succinate_err, 'mo-', 'linewidth', 1);

errorbar(Ea_LB, grmax37_allconc_LB, grmax37_allconc_LB_err, 'ro-', 'linewidth', 1);

errorbar(Ea_NZCasePlus, grmax37_allconc_NZCasePlus, grmax37_allconc_NZCasePlus_err, 'go-', 'linewidth', 1);

set(gcf, 'Position', [0 0 400 300]);
set(gca, 'fontsize', 20);
box off;
xlabel('Activation energy (k_BT)');
ylabel('Max growth rate at 37 °C (1/h)');

%% Plot only kcat data
k = 1; % Use max concentration


figure;
errorbar(Ea_glucose(k), grmax37_allconc_glucose(k), grmax37_allconc_glucose_err(k), 'bo-', 'linewidth', 1);
hold on;

errorbar(Ea_acetate(k), grmax37_allconc_acetate(k), grmax37_allconc_acetate_err(k), 'ko-', 'linewidth', 1);

errorbar(Ea_succinate(k), grmax37_allconc_succinate(k), grmax37_allconc_succinate_err(k), 'mo-', 'linewidth', 1);

errorbar(Ea_LB(k), grmax37_allconc_LB(k), grmax37_allconc_LB_err(k), 'ro-', 'linewidth', 1);

errorbar(Ea_NZCasePlus(k), grmax37_allconc_NZCasePlus(k), grmax37_allconc_NZCasePlus_err(k), 'go-', 'linewidth', 1);

set(gcf, 'Position', [0 0 400 300]);
set(gca, 'fontsize', 20);
box off;
xlabel('Activation energy (k_BT)');
ylabel('Max growth rate at 37 °C (1/h)');

